package com.wanghua.mall.order.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.wanghua.common.dto.mq.SecKillOrderDto;
import com.wanghua.common.utils.PageUtils;
import com.wanghua.mall.order.entity.OrderEntity;
import com.wanghua.mall.order.vo.*;

import java.util.Map;

/**
 * 订单
 *
 * @author wanghua
 * @email 2367279431@qq.com
 * @date 2021-09-07 17:09:01
 */
public interface OrderService extends IService<OrderEntity> {

    PageUtils queryPage(Map<String, Object> params);

    /**
     * 为订单结算页面准备数据
     *
     * @return
     */
    OrderConfirmVo confirmOrder();

    /**
     * 下单
     *
     * @param orderSubmitVo
     * @return
     */
    OrderSubmitResponseVo submitOrder(OrderSubmitVo orderSubmitVo);

    /**
     * 根据订单号获取订单状态
     *
     * @param orderNo 订单号
     * @return
     */
    Integer getOrderStatus(String orderNo);

    /**
     * 关闭订单
     *
     * @param orderEntity
     */
    void closeOrder(OrderEntity orderEntity);

    /**
     * 创建订单需要支付的数据
     *
     * @param orderNo 订单号
     * @return
     */
    PayVo getOrderPay(String orderNo);


    /**
     * 查询某个用户的订单列表
     *
     * @param params
     * @return
     */
    PageUtils queryPageWithItem(Map<String, Object> params);

    /**
     * 处理支付宝支付的返回结果
     *
     * @param payAsyncVo
     * @return
     */
    String handlePayResult(PayAsyncVo payAsyncVo);

    /**
     * 创建秒杀订单
     * @param secKillOrderDto
     */
    void createSecKillOrder(SecKillOrderDto secKillOrderDto);
}

